package com.wangjw.springbootdemo.task;

import com.wangjw.springbootdemo.service.IDemoService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * Created by wangjw on 18/10/8.
 */
@Component
public class DemoTask {

    private static final Logger logger = LoggerFactory.getLogger(TestTask.class);

    @Autowired
    private IDemoService iDemoService;

//    @Scheduled(cron = "*/2 * * * * ?")
    public void doDemoTask() {
        logger.info("task");
        iDemoService.doDemo();
    }
}
